/*
 * @lc app=leetcode.cn id=62 lang=javascript
 *
 * [62] 不同路径
 */

// @lc code=start
/**
 * @param {number} m
 * @param {number} n
 * @return {number}
 */
var uniquePaths = function(m, n) {
let steps = [];
for (let index = 0; index < m; index++) {
    steps[index] = new Array();
    
}
for(let i = 0;i<m;i++){
    for (let j = 0; j < n; j++) {
        if(i==0||j==0){
            steps[i][j] = 1
        }else{
            steps[i][j] = steps[i-1][j]+ steps[i][j-1]
        }
        
    }
}
return steps[m-1][n-1]

};
// @lc code=end

